<%@page import="com.mongodb.BasicDBObject"%>
<%@page import="net.sf.json.JSONObject"%>
<%@page import="net.sf.json.JSONArray"%>
<%@page import="org.apache.http.HttpResponse"%>
<%@page import="com.mongodb.DBObject"%>
<%@page import="com.mongodb.DBCursor"%>
<%@page import="org.apache.http.impl.client.DefaultHttpClient"%>
<%@page import="org.apache.http.client.methods.HttpGet"%>
<%@page import="org.apache.http.util.EntityUtils"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ page import="com.jiangjun.fetch.mongo.MongoDBSupport"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>pic show</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$.ajax({
		type : "get",
		dataType : "json",
		url : "showWeiboAction.do?type=2",
		data : "cpage=" + 1,
		success : function(msg){
			$(msg).each(function(){
				var json = eval(this);
				var vhtml = "<hr /><div><h3>" + json.parent_name + " " + json.date + " " + json.id + "</h3><h4>" +json.title+ "</h4><img src=" +json.img_path + " />"
				$('#picShow').append(vhtml);
				});
			var pi = parseInt($('#pageIndex').val());
			$('#pageIndex').val(pi + 1);
			}
		});
	
	$('#loadMore').click(function(){
		var vhtml = $("#picShow").html();
		var pageIndex = $('#pageIndex').val();
		$.ajax({
			type : "get",
			dataType : "json",
			url : "showWeiboAction.do?type=2",
			data : "cpage=" + pageIndex,
			success : function(msg){
				$(msg).each(function(){
					var json = eval(this);
					var vhtml = "<hr /><div><h3>" + json.parent_name + " " + json.date + " " + json.id + "</h3><h4>" +json.title+ "</h4><img src=" +json.img_path + " />"
					$('#picShow').append(vhtml);
					});
				var pi = parseInt($('#pageIndex').val());
				$('#pageIndex').val(pi + 1);
				}
			});
	});
});
</script>
</head>
<body>
	<div id="picShow">
	</div>
	<div>
		<input type="hidden" id="pageIndex" name="pageIndex" value="1"/>
		<button id="loadMore" name="loadMore" value="加载更多">加载更多</button>
	</div>
</body>
</html>
